package controller;

import model.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import service.StudentService;
import service.TeacherService;

import java.util.List;

@Controller
@RequestMapping("/Teacher")
public class TeacherController {
    @Autowired
    TeacherService teacherService;
    @RequestMapping(value = "list.do")
    public String list(Model model){
        List<Teacher> teachers=teacherService.findAll();
        model.addAttribute("teachers",teachers);
        return "listTeachers";

    }
}
